/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package centralehotel.modele;

import centralehotel.modele.FicheHotel;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Mathieu
 */
@Entity
@Table(name = "periode_tarif")
@NamedQueries({@NamedQuery(name = "PeriodeTarif.findByIdPeriodeTarif", query = "SELECT p FROM PeriodeTarif p WHERE p.idPeriodeTarif = :idPeriodeTarif"), @NamedQuery(name = "PeriodeTarif.findByDateDebut", query = "SELECT p FROM PeriodeTarif p WHERE p.dateDebut = :dateDebut"), @NamedQuery(name = "PeriodeTarif.findByDateFin", query = "SELECT p FROM PeriodeTarif p WHERE p.dateFin = :dateFin"), @NamedQuery(name = "PeriodeTarif.findByPrixSimple", query = "SELECT p FROM PeriodeTarif p WHERE p.prixSimple = :prixSimple"), @NamedQuery(name = "PeriodeTarif.findByPrixDouble", query = "SELECT p FROM PeriodeTarif p WHERE p.prixDouble = :prixDouble"), @NamedQuery(name = "PeriodeTarif.findByPrixSuite", query = "SELECT p FROM PeriodeTarif p WHERE p.prixSuite = :prixSuite")})
public class PeriodeTarif implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "id_periode_tarif", nullable = false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Integer idPeriodeTarif;
    @Column(name = "date_debut")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateDebut;
    @Column(name = "date_fin")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateFin;
    @Column(name = "prix_simple")
    private Float prixSimple;
    @Column(name = "prix_double")
    private Float prixDouble;
    @Column(name = "prix_suite")
    private Float prixSuite;
    @JoinColumn(name = "fiche_hotel", referencedColumnName = "id_fiche_hotel")
    @ManyToOne
    private FicheHotel ficheHotel;

    public PeriodeTarif() {
    }

    public PeriodeTarif(Integer idPeriodeTarif) {
        this.idPeriodeTarif = idPeriodeTarif;
    }

    public Integer getIdPeriodeTarif() {
        return idPeriodeTarif;
    }

    public void setIdPeriodeTarif(Integer idPeriodeTarif) {
        this.idPeriodeTarif = idPeriodeTarif;
    }

    public Date getDateDebut() {
        return dateDebut;
    }

    public void setDateDebut(Date dateDebut) {
        this.dateDebut = dateDebut;
    }

    public Date getDateFin() {
        return dateFin;
    }

    public void setDateFin(Date dateFin) {
        this.dateFin = dateFin;
    }

    public Float getPrixSimple() {
        return prixSimple;
    }

    public void setPrixSimple(Float prixSimple) {
        this.prixSimple = prixSimple;
    }

    public Float getPrixDouble() {
        return prixDouble;
    }

    public void setPrixDouble(Float prixDouble) {
        this.prixDouble = prixDouble;
    }

    public Float getPrixSuite() {
        return prixSuite;
    }

    public void setPrixSuite(Float prixSuite) {
        this.prixSuite = prixSuite;
    }

    public FicheHotel getFicheHotel() {
        return ficheHotel;
    }

    public void setFicheHotel(FicheHotel ficheHotel) {
        this.ficheHotel = ficheHotel;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPeriodeTarif != null ? idPeriodeTarif.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PeriodeTarif)) {
            return false;
        }
        PeriodeTarif other = (PeriodeTarif) object;
        if ((this.idPeriodeTarif == null && other.idPeriodeTarif != null) || (this.idPeriodeTarif != null && !this.idPeriodeTarif.equals(other.idPeriodeTarif))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "centralehotel.exception.PeriodeTarif[idPeriodeTarif=" + idPeriodeTarif + "]";
    }

}
